﻿using UnityEngine;
using System.Collections;

public class UIAnim : MonoBehaviour {
	public NGUIAnimBase anim = new NGUIAnimBase();
	public NGUIAnimBase anim2 = new NGUIAnimBase();
	public  bool _isScale = false;
	public  float _valueChange = 0;
	// Use this for initialization
	void Start () {
		anim.OnUpdateValue += OnPositionXChange;
		anim2.OnUpdateValue += OnScaleChange;
	}

	void OnValueChange (float f1)
	{
		
	
	}
	
	// Update is called once per frame
	void Update () {
		anim.Update (Time.deltaTime);
	}

    void OnScaleChange(float f1){
		transform.localScale = Vector3.one * f1;
	}
	void OnPositionXChange (float f1){
		transform.Translate (new Vector3 (f1, 0, 0));
	}
	void OnPositionYChange(float f1){
		transform.Translate(new Vector3 (0, f1, 0));
	}
	void OnPositionZChange(float f1){
		transform.Translate (new Vector3 (0, 0, f1));
	}
}
